//
//  LayoutConst.swift
//  QianPingNew
//
//  Created by Apple on 2019/5/14.
//  Copyright © 2019 Apple. All rights reserved.
//

import UIKit

struct IPhone {
    static let BottomSafetyHeight: CGFloat = isIPhoneX() ? 34 : 0//苹果X底部安全区
    static let navigationBarHeight: CGFloat = 44//navigation 高度
    static let tabbarHeight: CGFloat = 49//tabar 高度
    static let statusHight: CGFloat = UIApplication.shared.statusBarFrame.height//状态栏高度
    static let screenHight: CGFloat = getScreenHeight()//屏幕高度
    static let screenWidth: CGFloat = getScreenWidth()//屏幕宽度
}

//是否苹果X
func isIPhoneX() -> Bool {
    return (UIScreen.main.bounds.height >= 812.0)
}
//是否苹果5
func isPhone5() -> Bool {
    //    屏幕宽度：320.0
    //    屏幕高度：568.0
    return getScreenWidth() == 320.0
}

//屏幕宽度
func getScreenWidth() -> CGFloat {
    return UIScreen.main.bounds.size.width
}
//屏幕高
func getScreenHeight() -> CGFloat {
    return UIScreen.main.bounds.size.height
}
//顶部状态栏高度
func getStatusHight() -> CGFloat {
    return UIApplication.shared.statusBarFrame.height
}
